<!doctype html>
<html lang="en">

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Template • TodoMVC</title>
	<link rel="stylesheet" href="node_modules/todomvc-common/base.css">
	<link rel="stylesheet" href="node_modules/todomvc-app-css/index.css">

</head>

<body>
	<section id="app" class="todoapp">
		<header class="header">
			<h1>todos</h1>
			<input class="new-todo" placeholder="What needs to be done?" autofocus @keyup.enter="handleNewTodo">
		</header>
		<!-- This section should be hidden by default and shown when there are todos -->
		<section class="main">
			<input id="toggle-all" class="toggle-all" type="checkbox" @click="handleToggleAll">
			<label for="toggle-all">Mark all as complete</label>
			<ul class="todo-list">
				<!-- These are here just to show the structure of the list items -->
				<!-- List items should get the class `editing` when editing and `completed` when marked as completed -->
				<li :class="{completed:todo.isCompleted,editing:todo.isEditing}" v-for="todo in  list" :key="todo.id">
					<div class="view">
						<input class="toggle" type="checkbox" v-model="todo.isCompleted">
						<label @dblclick="handleDoubleClickTodo(todo,$event)">{{todo.text}}</label>
						<button class="destroy" @click="handelRemoveTodo(todo.id)"></button>
					</div>
					<input class="edit" v-model="todo.text" @keyup.enter="handleEditTodo(todo)"
						@blur="handleEditTodo(todo)" @keyup.esc="handleCancelEditTodo(todo)" />
				</li>
				<!-- <li>
					<div class="view">
						<input class="toggle" type="checkbox">
						<label>Buy a unicorn</label>
						<button class="destroy"></button>
					</div>
					<input class="edit" value="Rule the web">
				</li> -->
			</ul>
		</section>
		<!-- This footer should be hidden by default and shown when there are todos -->
		<footer class="footer">
			<!-- This should be `0 items left` by default -->
			<span class="todo-count"><strong>{{remaining}}</strong> item left</span>
			<!-- Remove this if you don't implement routing -->
			<ul class="filters">
				<li>
					<a @click="hanldeFilterTodoStatus('All')" :class="{selected:status==='All'}" href="#/">All</a>
				</li>
				<li>
					<a @click="hanldeFilterTodoStatus('active')" :class="{selected:status==='active'}"
						href="#/active">Active</a>
				</li>
				<li>
					<a @click="hanldeFilterTodoStatus('completed')" :class="{selected:status==='completed'}"
						href="#/completed">Completed</a>
				</li>
			</ul>
			<!-- Hidden if no completed items are left ↓ -->
			<button class="clear-completed" @click="handleClearCompleted">Clear completed</button>
		</footer>
	</section>


	<!-- 引入vuejs -->
	<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
	<script src="js/app.js"></script>
</body>

</html>